package com.xm.servlet.background.commodity;

import com.google.gson.Gson;
import com.xm.entity.CommodityServe;
import com.xm.service.background.CommodityServeService;
import lombok.SneakyThrows;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


/**
 * 修改商品服务
 * @author 康文程
 * @date 2024-1-20 上午 11:48
 */
@WebServlet("/background/update/commodity/serve")
public class UpdateCommodityServeServlet extends HttpServlet {
    private final CommodityServeService service = new CommodityServeService();
    @SneakyThrows
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) {
        String commodityServe = req.getParameter("commodityServe");
        resp.getWriter().print(service.updateByCommodityServe(new Gson().fromJson(commodityServe, CommodityServe.class)));
    }
}
